<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        /* 画心*/
        * {
            margin: 0;
            padding: 0;
        }

        html,
        body {
            width: 100%;
            height: 100%;
        }

        body {
            width: 100%;
            height: 100%;
            background-color: pink;
            display: flex;
            flex-direction: row;
            justify-content: center;
            align-items: center;
        }

        .heart {
            width: 200px;
            height: 200px;
            background-color: red;
            position: relative;
            transform: rotate(45deg);
            animation: heart 1s linear infinite;
            box-shadow: 0 0 20px red;
        }

        .heart::before {
            content: "";
            width: 200px;
            height: 100px;
            background-color: red;
            position: absolute;
            top: -99px;
            left: 0px;
            border-radius: 100px 100px 0 0;
            box-shadow: 0 0 20px red;
        }

        .heart::after {
            content: "";
            width: 100px;
            height: 200px;
            background-color: red;
            position: absolute;
            top: 0px;
            left: -99px; /* 修正此处，去掉多余空格 */
            border-radius: 100px 0 0 100px;
            box-shadow: 0 0 20px red;
        }

        /*创造动画*/
        @keyframes heart {
            0% {
                transform: rotate(45deg) scale(1);
            }

            50% {
                transform: rotate(46deg) scale(1.2);
            }

            100% {
                transform: rotate(46deg) scale(1);
            }
        }
    </style>
</head>

<body>
    <div class="heart"></div>
</body>

</html>